<?php
include"config.php";

$id = $_GET['id'];

$kueri = mysql_query("select * from tbl_user where id_user = '$id'");
while($data = mysql_fetch_array($kueri)){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PB User</title>
</head>

<body>
<form action="proses_edit_user.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <table width="500" border="1" align="center" cellpadding="1" cellspacing="1">
    <tr>
      <td colspan="3" align="center">Edit User </td>
    </tr>
    <tr>
      <td>Username</td>
      <td>:</td>
      <td><input name="username" type="text" id="username" value="<?=$data['username'];?>" /></td>
    </tr>
    <tr>
      <td>Password</td>
      <td>:</td>
      <td><input name="password" type="password" id="password" /></td>
    </tr>
    <tr>
      <td>Owner</td>
      <td>:</td>
      <td><input name="nama" type="text" id="nama" value="<?=$data['nama'];?>" /></td>
    </tr>
    <tr>
      <td>Level</td>
      <td>:</td>
      <td>
	  <select name="level" id="level">
      	<option value="1" <?php if($data['level'] == 1){ echo"selected=\'selected\'"; } ?>>Admin</option>
      	<option value="2" <?php if($data['level'] == 2){ echo"selected=\'selected\'"; } ?>>GM</option>
      </select>
          <input name="id" type="hidden" id="id" value="<?=$id;?>" /></td>
    </tr>
    <tr>
      <td>Status</td>
      <td>:</td>
      <td><select name="status" id="status">
        <option value="1" <?php if($data['status'] == 1){ echo"selected=\'selected\'"; } ?>>Active</option>
        <option value="2" <?php if($data['status'] == 2){ echo"selected=\'selected\'"; } ?>>Deactive</option>
                  </select></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Submit" /></td>
    </tr>
  </table>
</form>
</body>
</html>
<?php
}
?>